package com.niknik.woody.rest;

import com.niknik.woody.core.room.Room;

import java.util.ArrayList;
import java.util.List;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

/**
 * User: yoda
 * Date: 10.12.11
 * Time: 13:16
 */

public class RestTestContext {

  public final String playerId = "13";

  public final String wrongLongId = "wrong_long_id";

  public final String roomToken = "TOKEN";

  public String exMsg = "exception message";

  public final String firstRoomId = "1408";
  public final String secondRoomId = "1409";
  public final String thirdRoomId = "1410";

  public final String newRoomId = "1411";

  public final String motExistingRoomId = "666";

  public final String monitoredRoomId = "777";

  public final Room firstRoom = mock(Room.class);
  public final Room secondRoomInactive = mock(Room.class);
  public final Room thirdRoom = mock(Room.class);

  public final Room newRoom = mock(Room.class);

  public final Room monitoredRoom = mock(Room.class);

  public final List<Room> rooms = new ArrayList<Room>() {{
    add(firstRoom);
    add(secondRoomInactive);
    add(thirdRoom);
  }};

  {
    when(firstRoom.getId()).thenReturn(firstRoomId);
    when(firstRoom.isActive()).thenReturn(true);

    when(secondRoomInactive.getId()).thenReturn(secondRoomId);
    when(secondRoomInactive.isActive()).thenReturn(false);

    when(thirdRoom.getId()).thenReturn(thirdRoomId);
    when(thirdRoom.isActive()).thenReturn(true);

    when(newRoom.getId()).thenReturn(newRoomId);
    when(newRoom.isActive()).thenReturn(true);

    when(monitoredRoom.getId()).thenReturn(monitoredRoomId);
    when(monitoredRoom.isActive()).thenReturn(true);
  }

  public String move = "TEST_MOVE";

  public Integer gameExMsgCode = 314;
}